<!DOCTYPE html>
<html>
<head>

<title>Aplicación Municipal</title>

<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

 <link rel="stylesheet" href="css/jquery.mobile-1.3.1.css" />
 <link rel="stylesheet" type="text/css" href="themes/themes.css" />
 
 <script  type="text/javascript" src="js/jquery-1.9.1.js"> </script>
 <script  type="text/javascript" src="js/jquery.mobile-1.3.0.js"> </script>
 <script  type="text/javascript" src="js/cordova-2.5.0.js" charset="utf-8" ></script>
 <script>
 function consultarNoticia(){
	 var lstCriterio = $("#lstCriterio").val();
	 alert(lstCriterio);
	 
	 $.ajaxSetup( {cache: false} );
	 
	 $("#consultFrom").empty();
	 
	 $.getJSON("http://192.168.1.39/appMunicipalidad/MunicipalidadREST/noticias_REST.php", {Ambito: lstCriterio}, function(data){
		 
		 for(var i=0; i<data.length; i++  ) {
			 
			 var objeto = data[i];
			 
			 $("#resultado").append("<li>"+objeto.nombre + " "+objeto.hora +" </li>" );
		 }
		 
	 } );
 }
 </script>

</head>

<body>

	<div data-role="page"> 
		<div data-role="header" data-theme="b" data-position="fixed">
			<h1>Noticia</h1>
			
		</div>
		<div data-role="content">
		
			<form>
				<div data-role="fieldcontain">
					<label for="lstCriterio" data-theme="a">¿Qué Notica desea consultar?</label>
					<select name="lstCriterio" id="lstCriterio" data-mini="true">
				        <option value="">...</option>
				        <option value="economico">Economico</option>
				        <option value="gastronomico">Gastronomico</option>
				        <option value="politico">Politico</option>
				        <option value="Deportivo">Deportivo</option>
				        <option value="chismes">Metiche</option>	        
				     </select>			    
				</div>
				 <input type="button" value="Consultar" data-theme="a" onclick="consultarNoticia()"/>		
				 
				 <ul id="resultado">   </ul>		
		  </form>
			
		</div>
		<div data-role="footer" data-theme="b" data-position="fixed">
			<div data-role="navbar">
				<ul>
					<li><a href="comentarios.html" data-transición = "flujo"  rel="external" href="d" data-icon="start">Comentar</a></li>
					<li><a href="menu.html" data-transición = "flujo"  rel="external" href="d" data-icon="start">Menú</a></li>
				</ul>
				
			</div>
		</div>
		
	</div>

</body>
</html>